\documentclass{article}
\usepackage{array}
\begin{document}

This is a sample text, see e.g. $f(x) = 1$.

\begin{tabular}{*{3}{>{$}c<{$}}}
  a & b & c \\\hline
  1 & 2 & 3
\end{tabular}

Here it should not be in the math mode. 

\end{document}
